import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/pages/index'
import Login from '@/pages/login/index'
import User from '@/pages/user/index'
import Goods from '@/pages/goods/index'
import Project from '@/pages/project/index'
import UserFile from '@/pages/user/file'
import Cost from '@/pages/cost/index'
import Staff from '@/pages/staff/index'
import Log from '@/pages/log/index'
import Mark from '@/pages/mark/index'
import MarkTime from '@/pages/mark/timeTable'
import Form from '@/pages/form/index'
import StoreInfo from '@/pages/store/info'
import StorePass from '@/pages/store/pass'
Vue.use(Router)
export default new Router({
  routes: [
    {
      path: '/',
      name: '首页',
      component: Index
    },
    {
      path: '/login',
      name: '登陆',
      component: Login
    },
    {
      path: '/user',
      name: '会员管理',
      component: User
    },
    {
      path: '/user/file',
      name: '会员档案',
      component: UserFile
    },
    {
      path: '/project',
      name: '项目管理',
      component: Project
    },
    {
      path: '/goods',
      name: '商品管理',
      component: Goods
    },
    {
      path: '/staff',
      name: '员工管理',
      component: Staff
    },
    {
      path: '/cost',
      name: '支出费用',
      component: Cost
    },
    {
      path: '/form',
      name: '报表统计',
      component: Form
    },
    {
      path: '/log',
      name: '业务日志',
      component: Log
    },
    {
      path: '/mark',
      name: '预约管理',
      component: Mark
    },
    {
      path: '/mark/timeTable',
      name: '预约时间表',
      component: MarkTime
    },
    {
      path: '/store/info',
      name: '商户信息',
      component: StoreInfo
    },
    {
      path: '/store/pass',
      name: '密码重置',
      component: StorePass
    }
  ]
})
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
